Skip to content

app/vmui: improve stream context modal#1439

Open
Loori-R wants to merge 4 commits into
masterfrom
vmui/stream-context-improvements
Open

app/vmui: improve stream context modal#1439
Loori-R wants to merge 4 commits into
masterfrom
vmui/stream-context-improvements

Conversation

@Loori-R
Copy link
Copy Markdown
Contributor

@Loori-R Loori-R commented May 20, 2026

Describe Your Changes

  • change log ordering in the Log context modal: previous logs are shown above the target log, next logs are shown below it
  • replace manual Load more controls and the logs-per-load selector with top/bottom infinite scroll
  • load context with an adaptive stream_context time_window: start from 1m, expand exponentially when fewer logs than requested are returned, and stop at 7d. Related issue: app/vmui: allow configuring stream_context time_window in Log Context #1397
  • detect logs with identical _time values, show a warning, and highlight their timestamp values
image Screen Recording 2026-05-20 at 18 06 39

- warn and highlight logs with identical timestamps
- show older logs above and newer logs below the target log
- replace load control buttons with infinite scroll
- expand stream_context time_window from 1m to 7d while loading context
@Loori-R Loori-R added the web-ui Issues related to the user interface: layout, styling, usability, or UI-specific bugs. label May 20, 2026
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 issues found across 13 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread app/vmui/packages/vmui/src/pages/StreamContext/StreamContextList.tsx Outdated
Comment thread app/vmui/packages/vmui/src/pages/StreamContext/helpers.ts
Co-authored-by: cubic-dev-ai[bot] <191113872+cubic-dev-ai[bot]@users.noreply.github.com>
Signed-off-by: Yury Moladau <yurymolodov@gmail.com>
@arturminchukov
Copy link
Copy Markdown
Member

Should we keep the expanded logs state? When I load more logs, the expanded logs become closed.

Screen.Recording.2026-05-22.at.11.25.41.mov

...prev,
[dir]: data.length >= lines,
}));
if (data.length >= lines || isMaxTimeWindow(timeWindow)) {
Copy link
Copy Markdown
Contributor

@hagen1778 hagen1778 May 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I observe it right now, the logic is the following:

Image
  • we always request N records until we get all N
  • we keep requesting at the same timestamp but extending time_window until we get all N

This is simple logic and it works. But it has few downsides:

  1. In cases when there is a gap between log entries and we dont' get requests N logs - we will continue getting them with every time_window extension, over and over.
  2. This delays logs renderring as we might have to wait for multiple requests to complete until we get our N logs, while we already had some payload to render from previous requests

Here's a clip where request was repeating until it fit N entries

Screen.Recording.2026-05-22.at.09.50.59.mov

It would be nice to try to render some logs from that 2.7KiB received log entries, shift timestamp, extend time window and try new request from that position. And continue trying them until all N records were renderred.

Image

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. The loading now accumulates fetched logs, requests only the remaining count, and continues from the edge log of the previous response while expanding time_window.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Loori-R ! Is there a way to not wait for the all N to be collected, but spill out log entries as soon as they're available?

Comment thread docs/victorialogs/CHANGELOG.md Outdated
@hagen1778
Copy link
Copy Markdown
Contributor

Should we keep the expanded logs state? When I load more logs, the expanded logs become closed.

I am okay with collapsing the log entry on loading more logs.

Co-authored-by: Roman Khavronenko <roman@victoriametrics.com>
Signed-off-by: Yury Moladau <yurymolodov@gmail.com>
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 3 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.
Tip: cubic used a learning from your PR history. Let your coding agent read cubic learnings directly with the cubic MCP.

Fix all with cubic | Re-trigger cubic

Comment thread app/vmui/packages/vmui/src/pages/StreamContext/helpers.ts
@Loori-R Loori-R force-pushed the vmui/stream-context-improvements branch from 52f5af4 to dbdc187 Compare May 22, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

web-ui Issues related to the user interface: layout, styling, usability, or UI-specific bugs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

app/vmui: allow configuring stream_context time_window in Log Context

3 participants